

import re


def find_contents(content, pattern):
    contents = []
    while len(content) > 0:
        var1 = re.search(pattern, content)
        if var1 is not None:
            span_value = var1.span()
            contents.append(content[span_value[0]:span_value[1]])
            content = content[span_value[1]:]
        else:
            break
    return contents


if __name__ == '__main__':

    for con in find_contents('http://wwww.python.org/www/', 'w*w'):
        print(con)



